package com.zghhost.codedemo.mq.rabbitmq;

import com.rabbitmq.client.Channel;

public class AmqpProduserTest {
    public static void main(String[] args)throws Exception{
        Channel channel = ConnectionFactoryTest.getNewChannel();

        int i = 0;
        while(true){
            String s = "Hello, world!"+ ++i;
            byte[] messageBodyBytes = s.getBytes();
            channel.basicPublish(ConnectionFactoryTest.TEST_EX_NAME, ConnectionFactoryTest.ROUTING_KEY, null, messageBodyBytes);
            new Thread().sleep(1000);
        }
    }
}
